import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import alias from "@rollup/plugin-alias";
import path from "path";

// https://vitejs.dev/config/
export default defineConfig({
    base: './',
    resolve: {
        extensions: ['.vue', '.js'],
        alias: {
            "@": path.resolve(__dirname, "src")
        }
    },
    server: {
        port: 2800, //挂载端口
        proxy: {
            '/api': {
                target: 'https://39.96.83.19:5200',
                changeOrigin: true,
                rewrite: (path) => path.replace(/^\/api/, '/')
            }
        }
    },
    plugins: [
        alias(),
        vue()
    ]
})